package com.ytjj.qmyx.supplychain.api.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ytjj.qmyx.supplychain.common.api.CommonPage;
import com.ytjj.qmyx.supplychain.common.api.CommonResult;
import com.ytjj.qmyx.supplychain.common.api.ResultCode;
import com.ytjj.qmyx.supplychain.common.exception.ApiException;
import com.ytjj.qmyx.supplychain.common.model.bill.request.BankerBillRequest;
import com.ytjj.qmyx.supplychain.common.model.request.*;
import com.ytjj.qmyx.supplychain.common.model.response.BankerResponse;
import com.ytjj.qmyx.supplychain.common.model.response.CebCountryResponse;
import com.ytjj.qmyx.supplychain.common.model.response.CebUnitResponse;
import com.ytjj.qmyx.supplychain.common.model.response.OrderExceptionNoteResponse;
import com.ytjj.qmyx.supplychain.common.model.response.address.AndroidProvinceEntity;
import com.ytjj.qmyx.supplychain.common.model.response.address.H5Response;
import com.ytjj.qmyx.supplychain.common.model.response.address.IOSProvinceEntity;
import com.ytjj.qmyx.supplychain.mapper.CebCountryMapper;
import com.ytjj.qmyx.supplychain.mapper.CebUnitMapper;
import com.ytjj.qmyx.supplychain.mapper.OrderExceptionNoteMapper;
import com.ytjj.qmyx.supplychain.mapper.entity.*;
import com.ytjj.qmyx.supplychain.mapper.model.OrderExceptionNoteReq;
import com.ytjj.qmyx.supplychain.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;

@Slf4j
@RestController
@RequestMapping("/banker")
public class BankerController {
    @Autowired
    private BankerService bankerService;
    @Autowired
    private BankerSiteService bankerSiteService;
    @Autowired
    private BankerApplyService bankerApplyService;
    @Autowired
    private BankerInfoService bankerInfoService;
    @Autowired
    private BankerProductService bankerProductService;
    @Autowired
    private BankerBrandService bankerBrandService;
    @Autowired
    private BankerLabelService bankerLabelService;
    @Autowired
    private ProvincesService provincesService;
    @Autowired
    private OrderExceptionService orderExceptionService;
    @Resource
    private OrderExceptionNoteMapper orderExceptionNoteMapper;
    @Resource
    private CebCountryMapper cebCountryMapper;
    @Resource
    private CebUnitMapper cebUnitMapper;

    /**
     * 新增供应商
     * @param banker
     * @return
     */
    @PostMapping("/addBanker")
    public CommonResult addBanker(@RequestBody BankerRequest banker) {
        YxBanker data = bankerService.addBanker(banker);
        return CommonResult.success(data);
    }

    /**
     * 供应商列表
     * @param bankerRequest
     * @return
     */
    @PostMapping("/list")
    public CommonPage bankerList(@RequestBody BankerRequest bankerRequest) {
        return bankerService.bankerList(bankerRequest);
    }

    /**
     * 供应商- 申请记录列表
     * @param request
     * @return
     */
    @PostMapping("/applyList")
    public CommonResult applyList(@RequestBody BankerApplyRequest request) {
        return CommonResult.success(bankerApplyService.selectList(request));
    }

    /**
     * 供应链-商品打回
     * @param bankerProductId
     * @return
     */
    @GetMapping("/rollBack")
    public CommonResult rollBack(@RequestParam Integer bankerProductId, @RequestParam(value = "message", required = false) String message) {
        bankerApplyService.rollBack(bankerProductId, message);
        return CommonResult.success();
    }

    /**
     * 供应商申请打回
     * @param bankerProductId
     * @param message
     * @return
     */
    @GetMapping("/bankerApplyRollBack")
    public CommonResult bankerApplyRollBack(@RequestParam Integer bankerProductId, @RequestParam(value = "message", required = false) String message) {
        bankerApplyService.bankerAppRollBack(bankerProductId, message);
        return CommonResult.success();
    }

    /**
     * 供应链-移除商品
     * @param productId
     * @param message
     * @return
     */
    @GetMapping("/remove")
    public CommonResult remove(@RequestParam Integer productId, @RequestParam(value = "message", required = false) String message) {
        bankerApplyService.removeSupplychainProduct(productId, message);
        return CommonResult.success();
    }

    /**
     * 供应商-申请记录驳回
     * @param bankerProductId
     * @param bankerId
     * @param remark
     * @return
     */
    @GetMapping("/returnBack")
    public CommonResult returnBack(@RequestParam Integer bankerProductId, @RequestParam Integer bankerId, @RequestParam String remark) {
        bankerApplyService.returnBack(bankerProductId, bankerId, remark);
        return CommonResult.success();
    }

    /**
     * 供应商店铺列表
     * @param bankerSiteRequest
     * @return
     */
    @PostMapping("/siteList")
    public CommonResult selectList(@RequestBody BankerSiteRequest bankerSiteRequest) {
        return CommonResult.success(bankerSiteService.selectList(bankerSiteRequest));
    }

    /**
     * 供应商主体列表
     * @param bankerInfoRequest
     * @return
     */
    @PostMapping("/bodyList")
    public CommonResult selectBodyList(@RequestBody BankerInfoRequest bankerInfoRequest) {
        return CommonResult.success(bankerInfoService.selectList(bankerInfoRequest));
    }

    /**
     * 供应商产品库
     * @param bankerProductRequest
     * @return
     */
    @PostMapping("/productList")
    public CommonResult selectList(@RequestBody BankerProductRequest bankerProductRequest) {
        // todo 这里销售端需要自行处理商品所属活动
        return CommonResult.success(bankerProductService.selectList(bankerProductRequest));
    }

    /**
     * 供应商品牌管理
     * @param bankerBrandRequest
     * @return
     */
    @PostMapping("/brandList")
    public CommonResult selectList(@RequestBody BankerBrandRequest bankerBrandRequest) {
        return CommonResult.success(bankerBrandService.selectList(bankerBrandRequest));
    }

    /**
     * 供应商标签-分页查询
     * @param bankerLabelName
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/bankeLabelList")
    public CommonPage bankeLabelList(@RequestParam(value = "bankerLabelName", required = false) String bankerLabelName,
                                     @RequestParam(value = "pageNum", defaultValue = "1", required = false)Integer pageNum,
                                     @RequestParam(value = "pageSize", defaultValue = "10", required = false)Integer pageSize) {
        return bankerLabelService.select(bankerLabelName,pageNum,pageSize);
    }

    /**
     * 查询所有供应商标签
     * @param bankerLabelName
     * @return
     */
    @GetMapping("/bankeLabelAllList")
    public CommonResult bankeLabelAllList(@RequestParam(value = "bankerLabelName", required = false) String bankerLabelName) {
        return bankerLabelService.selectNoPage(bankerLabelName);
    }

    /**
     * 查询所有助理
     * @return
     */
    @GetMapping("/assistantList")
    public CommonResult assistantList() {
        return CommonResult.success(bankerService.queryAssistantList());
    }

    /**
     * 查询所有采购员
     * @return
     */
    @GetMapping("/buyerList")
    public CommonResult buyerList() {
        return CommonResult.success(bankerService.queryBuyerList());
    }

    /**
     * 供应商绑定标签
     * @return
     */
    @PostMapping("/addBankerLabel")
    public CommonResult addBankerLabel(@RequestBody UpdateLabelRequest updateLabelRequest) {
        return bankerLabelService.addBankerLabel(updateLabelRequest.getBankerIds(), updateLabelRequest.getBankerLabelIds(), updateLabelRequest.getAdminId());
    }

    /**
     * 供应商停用
     * @param id
     * @param status
     * @param msg
     * @return
     */
    @GetMapping("/updateStatusBanker")
    public CommonResult updateStatusBanker(@RequestParam("id") Integer id,
                                           @RequestParam("status") Integer status,
                                           @RequestParam(required = false, name = "msg") String msg) {
        bankerService.updateStatusBanker(id, status, msg);
        return CommonResult.success();
    }

    /**
     * 释放店铺信息
     * @param request
     * @return
     */
    @PostMapping("/release_site")
    public CommonResult releaseSite(@RequestBody BankerUpdateReleaseRequest request) {
        return bankerSiteService.release(request);
    }

    /**
     * 供应商主体身份信息
     * @param id
     * @return
     */
    @GetMapping("/selectIdentity")
    public CommonResult selectIdentity(Integer id) {
        return CommonResult.success(bankerInfoService.selectIdentity(id));
    }

    /**
     * 释放供应商主体信息
     * @param request
     * @return
     */
    @PostMapping("/releaseBanker")
    public CommonResult releaseBanker(@RequestBody BankerUpdateReleaseRequest request) {
        return bankerInfoService.release(request);
    }

    /**
     * 供应商商品--查看详情
     * @param productId
     * @return
     */
    @GetMapping("/bankerProductDetail")
    public CommonResult bankerProductDetail(@RequestParam Integer productId) {
        return CommonResult.success(bankerProductService.bankerProductDetail(productId));
    }

    /**
     * 供应链商品--查看详情
     * @param productId
     * @return
     */
    @GetMapping("/productDetail")
    public CommonResult productDetail(@RequestParam Integer productId) {
        return CommonResult.success(bankerProductService.productDetail(productId));
    }

    /**
     * 供应商品牌下架
     * @param request
     * @return
     */
    @PostMapping("/putOnBankerBrand")
    public CommonResult putOnBankerBrand(@RequestBody BankerUpdatePutOnRequest request) {
        log.info("===供应商品牌上下架==={}", request);
        CommonResult result = bankerBrandService.brandPutOn(request);
        return result;
    }

    /**
     * 修改供应商品牌名称
     * @param request
     * @return
     */
    @PostMapping("/updateBrandName")
    public CommonResult updateBrandName(@RequestBody BrandUpdateNameRequest request) {
        return bankerBrandService.updateBrandName(request);
    }

    /**
     * 释放品牌
     * @param request
     * @return
     */
    @PostMapping("/release_brand")
    public CommonResult releaseBrand(@RequestBody BankerUpdateReleaseRequest request) {
        return bankerBrandService.release(request);
    }

    /**
     * 增加修改标签
     * @param bankerLabelName 名
     * @param bankerLabelId id
     * @return CommonResult
     */
    @GetMapping("/addAndUpdate")
    public CommonResult addAndUpdate(@RequestParam(value = "bankerLabelName") String bankerLabelName,
                                     @RequestParam(value = "bankerLabelId",required = false) Integer bankerLabelId,
                                     @RequestParam(value = "colour") String colour,
                                     @RequestParam(value = "adminId") Integer adminId,
                                     @RequestParam(value = "shopId") String shopId) {
        return bankerLabelService.addAndUpdate(bankerLabelName, bankerLabelId, adminId, colour);
    }

    /**
     *  删除标签
     * @param bankerLabelId 标签id
     * @return CommonResult
     */
    @GetMapping("/delete")
    public CommonResult delete(@RequestParam(value = "bankerLabelId") Integer bankerLabelId) {
        return bankerLabelService.delete(bankerLabelId);
    }

    /**
     * 审核供应商店铺信息
     * @param request
     * @return
     */
    @PostMapping("/checkBankerSite")
    public CommonResult checkBankerSite(@RequestBody BankerCheckStatusRequest request) {
        return bankerSiteService.checkStatus(request);
    }

    /**
     * 供应商-主体审核通过
     * @param bankerInfoRequest
     * @return
     */
    @PostMapping("/verifySuccess")
    public CommonResult verifySuccess(@RequestBody BankerInfoRequest bankerInfoRequest) {
        Integer count = bankerInfoService.verifySuccess(bankerInfoRequest.getId(), bankerInfoRequest.getAdminName());
        if(count > 0) {
            return CommonResult.success(count);
        } else {
            return CommonResult.failed();
        }
    }

    /**
     * 供应商-主体审核失败
     * @param bankerInfoRequest
     * @return
     */
    @PostMapping("/verifyFailBankerInfo")
    public CommonResult verifyFailBankerInfo(@RequestBody BankerInfoRequest bankerInfoRequest) {
        Integer count = bankerInfoService.verifyFail(bankerInfoRequest.getId(), bankerInfoRequest.getRejectReason(), bankerInfoRequest.getAdminName());
        if(count > 0) {
            return CommonResult.success(count);
        } else {
            return CommonResult.failed();
        }
    }

    /**
     * 供应商-产品审核成功
     * @param product
     * @return
     */
    @PostMapping("/syncBankerToProduct")
    public CommonResult syncBankerToProduct(@RequestBody ProductCheckRequest product) {
        return CommonResult.success(bankerProductService.syncBankerToProduct(product));
    }

    /**
     * 供应商-产品审核失败
     * @param productVerifyRequest
     * @return
     */
    @PostMapping("/verifyFailProduct")
    public CommonResult verifyFailProduct(@RequestBody ProductVerifyRequest productVerifyRequest) {
        return CommonResult.success(bankerProductService.verifyFail(productVerifyRequest));
    }

    /**
     * 供应商-品牌信息审核
     * 包含成功和失败
     * @param request
     * @return
     */
    @PostMapping("/checkBankerBrand")
    public CommonResult checkBankerBrand(@RequestBody BankerCheckStatusRequest request) {
        return bankerBrandService.checkStatus(request);
    }

    //获取省份
    @GetMapping("/getProvince")
    public CommonResult getProvince(@RequestParam(value="id",required=false) Integer id) {
        return CommonResult.success(provincesService.getProvince(id));
    }

    //根据省份id
    @GetMapping("/getCity")
    public CommonResult getCity(@RequestParam(value="id",required=false) Integer id) {
        return CommonResult.success(provincesService.getCity(id));
    }

    //根据城市id
    @GetMapping("/getArea")
    public CommonResult getArea(@RequestParam(value="id",required=false) Integer id) {
        return CommonResult.success(provincesService.getArea(id));
    }

    /**
     * 获取黑名单手机号列表
     * @return
     */
    @GetMapping("/getBalckUsers")
    public List<String> getBalckUsers(){
        return provincesService.getBalckUsers();
    }

    /**
     * H5获取地址接口
     * @return
     */
    @GetMapping("/getH5Address")
    public CommonResult getH5Address() {
        List<H5Response> responses = JSON.parseArray(provincesService.getH5Address(),H5Response.class);
        return CommonResult.success(responses);
    }

    /**
     * ios获取地址接口
     * @return
     */
    @GetMapping("/getIOSAddress")
    public CommonResult getIOSAddress() {
        List<IOSProvinceEntity> iosProvinceEntityList = JSON.parseArray(provincesService.getIOSAddress(),IOSProvinceEntity.class);
        return CommonResult.success(iosProvinceEntityList);
    }

    /**
     * 安卓获取地址
     * @return
     */
    @GetMapping("/getAndroidAddress")
    public CommonResult getAndroidAddress() {
        List<AndroidProvinceEntity> androidProvinceEntityList = JSON.parseArray(provincesService.getAndroidAddress(),AndroidProvinceEntity.class);
        return CommonResult.success(androidProvinceEntityList);
    }

    /**
     * 获取省市区地址接口
     * @return
     */
    @GetMapping("/getAllAddress")
    public CommonResult getAllAddress() {
        Map<String, Object> data = JSON.parseObject(provincesService.getAllAddress(), HashMap.class);
        return CommonResult.success(data);
    }

    /**
     * ip获取的地址转换
     * @param province
     * @param city
     * @param area
     * @return
     */
    @GetMapping("/addressChange")
    public CommonResult addressChange(String province,String city,String area) {
        Map<String, String> result = provincesService.addressChange(province, city, area);
        return CommonResult.success(result);
    }

    /**
     * 微信地址转换
     * @param nationalCode
     * @param
     * @return
     */
    @GetMapping("/wxAddressChange")
    public CommonResult wxAddressChange(Integer nationalCode) {
        Map<String, String> result = provincesService.wxAddressChange(nationalCode);
        return CommonResult.success(result);
    }

    /**
     * 清楚地址缓存
     * @return
     */
    @GetMapping("/delRedisAddress")
    public CommonResult delRedisAddress() {
        provincesService.delRedisAddress();
        return CommonResult.success();
    }

    /**
     * 添加微信省份
     * @param provinceStr
     * @return
     */
    @PostMapping("/addWxProvince")
    public  CommonResult addWxProvince(String provinceStr) {
        log.info("添加微信省份参数：{}",provinceStr);
        YxProvinces provinces = provincesService.addWxProvince(provinceStr);
        return CommonResult.success(provinces);
    }

    /**
     * 添加微信城市
     * @param cityStr
     * @return
     */
    @PostMapping("/addWxCity")
    public  CommonResult addWxCity(String cityStr) {
        log.info("添加微信城市参数：{}",cityStr);
        YxCities cities = provincesService.addWxCity(cityStr);
        return CommonResult.success(cities);
    }

    /**
     * 添加微信区域
     * @param areaStr
     * @return
     */
    @PostMapping("/addWxArea")
    public  CommonResult addWxArea(String areaStr) {
        log.info("添加微信区域参数：{}",areaStr);
        YxAreas area = provincesService.addWxArea(areaStr);
        return CommonResult.success(area);
    }

    /**
     * 查询供应商品牌
     * @param bankerId
     * @return
     */
    @GetMapping("/queryBankerBrandList")
    public CommonResult queryBankerBrandList(@RequestParam(value = "bankerId") String bankerId) {
        return bankerBrandService.queryBankerBrandListByBankerId(Integer.parseInt(bankerId));
    }

    /**
     * 重置密码
     * @param request
     * @return
     */
    @PostMapping("/resetPwd")
    public CommonResult resetPwd(@RequestBody BrandUpdateNameRequest request) {
        return bankerInfoService.resetPwd(request);
    }

    /**
     * 异常订单备注
     * @param id
     * @return
     */
    @GetMapping("/selectNote")
    public CommonResult selectNote (@RequestParam Integer id){
        List<YxOrderExceptionNote> list = orderExceptionService.selectNote(id);
        return CommonResult.success(list);
    }

    /**
     *根据子订单号查询异常订单备注
     */
    @PostMapping("/selectNoteByChildrenOrderNo")
    public List<OrderExceptionNoteResponse> selectNoteByChildrenOrderNo (@RequestBody OrderExceptionNoteRequest request){
        List<OrderExceptionNoteResponse> list = orderExceptionService.selectNoteByChildrenOrderNo(request.getChildOrderNoList());
        return list;
    }

    /**
     * 供应商异常订单跟踪页--批量备注
     * @param ids 多个id逗号分割
     * @param content 备注内容
     * @param adminName 操作人
     * @return
     */
    @GetMapping("/insertNote")
    CommonResult insertNote(String ids,String content,String adminName){
        return orderExceptionService.insertNoteBatch(ids,content,adminName);
    }


    @PostMapping("/batchInsertNote")
    CommonResult batchInsertNote(@RequestBody OrderExceptionNoteReq req){
    	
    	Date date = new Date();
    	List<YxOrderExceptionNote> list = req.getList();
    	String adminName = req.getAdminName();
    	
    	for(YxOrderExceptionNote vo:list) {
    		vo.setCreateTime(date);
    		vo.setAdminName(adminName);
    		orderExceptionNoteMapper.insert(vo);
    	}
    	return CommonResult.success();
    }
    
    
    
    /**
     * 根据供应商id 查询供应商信息
     * @param bankerId
     * @return
     */
    @GetMapping("/queryBankerById")
    public CommonResult queryBankerId(@RequestParam("bankerId") Integer bankerId) {
        YxBanker banker = bankerService.queryById(bankerId);
        return CommonResult.success(banker);
    }

    @GetMapping("/queryBankerSiteByBankerId")
    public CommonResult queryBankerSiteByBankerId(@RequestParam("bankerId") Integer bankerId) {
        YxBankerSite bankerSite = bankerSiteService.selectByBankerId(bankerId);
        if (null == bankerSite){
            return CommonResult.success();
        }
        return CommonResult.success(bankerSite);
    }

    @PostMapping("/updateBanker")
    public CommonResult updateBanker(@RequestBody BankerRequest banker) {
        bankerService.updateBanker(banker);
        return CommonResult.success(ResultCode.SUCCESS);
    }

    /**
     * 根据供应商名称获取供应商ids
     */
    @GetMapping("/getBankerIdByBankerName")
    public List<Integer> getBankerIdByBankerName(@RequestParam String bankerName){
        return bankerService.getBankerIdByBankerName(bankerName);
    }

    /**
     * 根据供应商id 查询供应商信息
     * @param bankerIds 多个用‘,’分隔
     * @return
     */
    @GetMapping("/queryBankerByIds")
    public CommonResult queryBankerIds(@RequestParam("bankerIds") String bankerIds) {
        List<String> bankerIdList_str = Arrays.asList(bankerIds.split(","));
        List<Integer> bankerIdList_integer = bankerIdList_str.stream().map(Integer::parseInt).collect(Collectors.toList());
        List<YxBanker> bankers = bankerService.queryByIds(bankerIdList_integer);
        return CommonResult.success(bankers);
    }

    /**
     * 根据供应商名称查询供应商信息
     * @param bankerName
     * @return
     */
    @GetMapping("/queryBankerByName")
    public CommonResult queryBankerByName(@RequestParam("bankerName") String bankerName) {
        YxBanker yxBanker = bankerService.queryByNameLike(bankerName);
        return CommonResult.success(yxBanker);
    }

    /**
     * 根据子订单号查询订单详情页
     * @param childOrderNo
     * @return
     */
    @GetMapping("/synchronizationOrderException")
    public YxOrderException synchronizationOrderException(@RequestParam("childOrderNo") String childOrderNo) {
        YxOrderException list = orderExceptionService.findOrderExceptionByChildOrderNo(childOrderNo);
        return list;
    }

    /**
     * 设置供应商放假信息
     */
    @PostMapping("/setHolidayMsg")
    public CommonResult setHolidayMsg(@RequestBody YxBankerHolidayMsg yxBankerHolidayMsg){
        return bankerService.setHolidayMsg(yxBankerHolidayMsg);
    }

    /**
     * 设置供应商放假信息
     */
    @GetMapping("/holidayMsg")
    public CommonResult holidayMsg(@RequestParam Integer bankerId){
        return bankerService.holidayMsg(bankerId);
    }

    /**
     * 根据商品id设置供应商放假信息-mall
     */
    @GetMapping("/holidayMsgToMall")
    public Integer holidayMsgToMall(@RequestParam Integer bankerId){
        return bankerService.holidayMsgToMall(bankerId);
    }


    /**
     * 报关用到的国家接口-新
     * @return
     */
    @GetMapping("/new_country_list")
    public CommonResult selectContryListNew() {
        List<CebCountryResponse> list = cebCountryMapper.queryCountryList();
        List<Map<String, Object>> result = new LinkedList<>();
        list.stream().forEach(item -> {
            Map<String, Object> map = new HashMap<>();
            map.put("code", item.getCode());
            map.put("name", item.getName());
            result.add(map);
        });
        return CommonResult.success(result);
    }

    /**
     * 报关用到的单位接口
     * @return
     */
    @GetMapping("/new_product_unit")
    public CommonResult selectProductUnitNew() {
        List<CebUnitResponse> list = cebUnitMapper.queryUnitList();
        List<Map<String, Object>> result = new LinkedList<>();
        list.stream().forEach(item -> {
            Map<String, Object> map = new HashMap<>();
            map.put("code", item.getCode());
            map.put("name", item.getName());
            result.add(map);
        });
        return CommonResult.success(result);
    }

    /**
     * 根据供应商信息查供应商(供应商名称,采购员)
     */
    @PostMapping("/getBankerIdsByBankerMsg")
    public String getBankerIdsByBankerMsg(@RequestBody BankerRequest request){
        return bankerService.getBankerIdsByBankerMsg(request);
    }


    /**
     * 查询供应商账单信息
     * @param request
     * @return
     */
    @PostMapping("/bill")
    public CommonResult bill(@RequestBody BankerBillRequest request){
        return bankerService.bill(request);
    }

    /**
     * 供应商合同新增-修改
     * @param request
     * @return
     */
    @PostMapping("/contract-add-update")
    public CommonResult contractAddUpdate(@RequestBody BankerContractNew request){
        return bankerService.contractAddUpdate(request);
    }

    /**
     * 供应商合同-列表
     * @param bankerId
     * @return
     */
    @GetMapping("/contract-list")
    public CommonResult contractList(@RequestParam Integer bankerId){
        return bankerService.contractList(bankerId);
    }

    /**
     * 供应商合同-删除
     * @param id
     * @return
     */
    @GetMapping("/contract-del")
    public CommonResult contractDel(@RequestParam Integer id){
        return bankerService.contractDel(id);
    }

    /**
     * 供应商合同-备注
     * @param bankerId
     * @param contractRemark
     * @return
     */
    @GetMapping("/contract-remark")
    public CommonResult contractRemark(@RequestParam Integer bankerId,@RequestParam String contractRemark){
        return bankerService.contractRemark(bankerId,contractRemark);
    }

    /**
     * 根据供应商名称查询供应商
     * @param bankerName 供应商名称
     * @return
     */
    @GetMapping("/getBankerInfoByName")
    public CommonResult getBankerInfoByName(String bankerName){
        return bankerService.getBankerInfoByName(bankerName);
    }

}
